#ifndef _DUAL_LIGHT_H_
#define _DUAL_LIGHT_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum DualLightType{
    DUAL_LIGHT_SYNC_FLASH = 0,         /* 并排闪烁 */
    DUAL_LIGHT_SYNC_FLASH_DOUBLE,      /* 并排双闪 */
    DUAL_LIGHT_ALTERNATE_FLASH,        /* 交替闪烁 */
    DUAL_LIGHT_ALTERNATE_FLASH_DOUBLE, /* 交替双闪 */
    DUAL_LIGHT_SINGLE_DOUBLE,          /* 单双闪 */
    DUAL_LIGHT_FLOW_WATER,             /* 流水灯 */
    DUAL_LIGHT_CHANGE_POSITION,        /* 交换位置 */
    DUAL_LIGHT_TOTAL,
} DualLightType;

typedef struct DualLight {
    void* priv;           /* 用户私有指针 */
    void* callback;       /* 回调函数 */
    DualLightType type;   /* 双灯闪烁方式 */
    uint32_t intenal[64]; /* 内部保留空间(用户不要访问) */
} DualLight;

typedef void(*DUAL_LIGHT_CALLBACK)(DualLight* dl, int32_t light1, int32_t light2);

/* 外部定时调用来驱动系统,intervalMs为调用间隔,不要大于100ms,尽量为50整数倍 */
int32_t duallight_driver(DualLight* dl, uint32_t intervalMs);

#ifdef __cplusplus
}
#endif

#endif // _DUAL_LIGHT_H_
